/*
* 类目 基础管理 协议管理
*/
import { getRequest, postRequest, postDownload, uploadRequest, downloadRequest } from '/@/lib/axios';

export const AgreeApi = {

    // 协议  列表 
    foundationList: (param) => {
        return postRequest('/foundation/blagreement/list', param);
    },
    // 协议  增加  
    foundationAdd: (param) => {
        return uploadRequest('/foundation/blagreement/save', param);
    },
    // 协议   修改  
    foundationUpdate: (param) => {
        return postRequest('/foundation/blagreement/update', param);
    },
    // 删除   
    foundationDelete: (categoryId) => {
        return postRequest(`/foundation/blagreement/delete`, categoryId);
    },

    //文件上传 /foundation/blprojectattach/upload?blProjectNum=1&type=1
    uploadFile: (folder, param) => {
        return postRequest(`/foundation/blprojectattach/upload?${folder}`, param);
    },

    // 捐赠 用途维护  /foundation/blfunduse/getAll

    getAllUse: () => {
        return getRequest(`/foundation/blfunduse/getAll`);
    },

    // 获取所有项目名称  /foundation/blproject/getByName
    getAllProject: () => {
        return getRequest(`/foundation/blproject/getByName`);
    },

    // 捐赠方  /foundation/bldonor/getAll
    getAllDonor: () => {
        return getRequest(`/foundation/bldonor/getAll`);
    },

    // 下载协议  /foundation/blagreement/download?blagreementid=1
    download: (blagreementid) => {
        return downloadRequest(`/foundation/blagreement/download?blagreementid=${blagreementid}`);
    },
    // 根据项目id获取附件  /foundation/blagreement/getAttach/1`   
    getIdsFile: (id) => {
        return getRequest(`/foundation/blagreement/getAttach/${id}`);
    }

};
